import React from 'react';
import {ScrollView, StyleSheet, View} from 'react-native';
import {routeConfigMapName} from '@nav/NavConstant';
import {Button} from '@ant-design/react-native';
import NavigationUtil from '@nav/NavigationUtil';

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});
export default class HomePage extends React.Component {
  constructor(props) {
    super(props);
  }

  click = routerName => {
    NavigationUtil.goPage(this.props.navigation, routerName, null);
  };

  renderItem = routeConfigMapName.map(routerName => {
    return (
      <View style={{margin: 20}}>
        <Button type="primary" onPress={() => this.click(routerName)}>
          {routerName}
        </Button>
      </View>

    );
  });

  render() {
    return <ScrollView>{this.renderItem}</ScrollView>;
  }
}
